<template>
	<view>
        <u-modal title=" " :show="showInquiry" closeOnClickOverlay @confirm="seeResult" showCancelButton>
        	<div style="text-align: center;">
        		<image style="width: 209rpx;height: 180rpx;display: inline-block;" src="https://pic.moresu.com/Fh4l-ozvqPZyWBmPhjbUxXiuRpxr" ></image>
        		<div style="font-weight: bold;line-height: 40px;color: #414141;font-size:28rpx;line-height: 60rpx;text-align: center;padding-top:10rpx;">{{text}}</div>
        	</div>
        
        	<div slot="confirmButton" class="u-flex">
        		<u-button
        		     shape="circle"
        			text="关闭"
        			:plain="true"
        			@click="closePop"
        		></u-button>
        		<div style="width:40rpx;height:10px;"></div>
        		<u-button
				     v-if="storeUserInfo.isBuyerAuth == 1"
        		     shape="circle"
        		    color="linear-gradient(90deg, #FF5E01 0%, #FF5E01 100%)"
        			text="确定"
        			type="primary"
        			@click="seeResult"
        		></u-button>
				<u-button
				     v-else
				     shape="circle"
				    color="linear-gradient(90deg, #FF5E01 0%, #FF5E01 100%)"
					text="去认证"
					type="primary"
					@click="goRZ"
				></u-button>
        	</div>
        		
        </u-modal>
	</view>
</template>
<script>

import{imgCheck} from '@/plugins/upload/upload.js'
import {editOrder,orderDeliverData,checkStoreStatus} from '@/config/api.js'
import store from '@/store';
const log = require('@/plugins/log.js')
export default {
    name: 'takeOrder',
    computed: {
    	
		
    },
	data() {
		return {
           showInquiry:false,
		   inquiryId:'',
		   text:'',
		   storeUserInfo:{}
		}
	},
    watch:{

    },
	created() {
	
	
	},
	methods: {
		closePop(){
			this.showInquiry = false
			log.info('询价提交成功弹窗&询价成功关闭按钮')
		},
		//显示结果
		showResult(res){
			this.inquiryId = res.inquiryId;
			this.showInquiry = true;
			this.storeUserInfo = store.state.userInfo;
			checkStoreStatus().then((res)=>{
				if(res != ''){
					this.text = res
				}else{
					if(this.storeUserInfo.isBuyerAuth == 1){
						this.text = '您的询价已提交成功！'
					}else{
						this.text = '已成功询价！完成认证后才能查看供应商的联系方式哦！'
					}
				}
				
			})
			
		},
		//跳转询价结果
		seeResult(){
			uni.navigateTo({
			  url: '/pages/inquiry/inquiryInfo?inquiryId='+this.inquiryId
			})
			this.showInquiry = false
			log.info('询价提交成功弹窗&询价成功查看按钮')
		},
		
		goRZ(){
			uni.navigateTo({
			  url: '/pagesUser/user/myAuthenticationInfo'
			})
		}
          
	}
};
</script>

<style lang="scss" scoped>


</style>
